package org.nowcoder.huawei.c100;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;

/**
 * 25:求最多可以派出多少支团队
 */
public class HC025 {


    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        String[] vars = br.readLine().split(" ");
        int[] ability = new int[n];
        for (int i = 0; i < vars.length; i++) {
            ability[i] = Integer.parseInt(vars[i]);
        }
        int k = Integer.parseInt(br.readLine());

        Arrays.sort(ability);
        int count = (int) Arrays.stream(ability).filter(x -> x >= k).count();
        count += solve(ability, n - count - 1, k);
        System.out.println(count);
    }

    public static int solve(int[] ability, int r, int k) {
        int count = 0;
        int l = 0;
        while (l < r) {
            if (ability[l] + ability[r] >= k) {
                count++;
                r--;
            }
            l++;
        }
        return count;
    }
}
